--# -path=.:alltenses

concrete Svenska of SvenskaAbs = CatSwe ** open (S=SyntaxSwe), (AS=AllSwe), (M=MorphoSwe), (C=CommonScand) in {

----------------------------------------
lin
som_helst ip = {
  s = \\c => ip.s!c ++ ["som helst"]; 
  a = M.agrP3 ip.g ip.n
};

----------------------------------------
lincat

Main = Text;

V_NP, V_Adv, V_Comp = V2;
VP_NP, VP_Adv, VP_Comp = VPSlash;
Cl_NP, Cl_Adv, Cl_Comp = ClSlash;
Adv_NP = Prep;

----------------------------------------
lin

ComplV_NP v np = AS.ComplSlash (AS.SlashV2a v) np;
ComplV_Adv v adv = C.insertObj (\\_ => adv.s) (AS.SlashV2a v);
ComplV_Comp v comp = C.insertObj comp.s (AS.SlashV2a v);
-- ComplV_Comp v comp = C.insertObj (\\a => comp.s ! C.agrAdjNP a C.DIndef) (AS.SlashV2a v);

SlashV_NP   = AS.SlashV2a; 
SlashV_Adv = AS.SlashV2a; 
SlashV_Comp = AS.SlashV2a;

PredVP_NP   = AS.SlashVP;
PredVP_Adv = AS.SlashVP;
PredVP_Comp = AS.SlashVP;

-- similar to QuestSlash:
FrontNP np cl = {
  s = \\t,a,p,o => cl.c2.s ++ np.s!C.accusative ++ cl.s!t!a!p!C.Inv ++ cl.n3!np.a
};

FrontAdv adv cl = let agr = M.agrP3 C.Utr C.Sg in {
  s = \\t,a,p,o => cl.c2.s ++ adv.s ++ cl.s!t!a!p!C.Inv ++ cl.n3!agr
};

-- no good: no agreement with the subject
FrontComp comp cl = let agr = M.agrP3 C.Utr C.Sg in {
  s = \\t,a,p,o => cl.c2.s ++ comp.s!agr ++ cl.s!t!a!p!C.Inv ++ cl.n3!agr
};

-- -- no good: no agreement with the subject
-- FrontComp comp cl = let acc = C.Weak C.Sg; agr = M.agrP3 C.Utr C.Sg in {
--   s = \\t,a,p,o => cl.c2.s ++ comp.s!acc ++ cl.s!t!a!p!C.Inv ++ cl.n3!agr
-- };

AdvSlash p = p ** {lock_Prep=<>};
lin SlashV_Adv_NP v adv = M.predV v ** {n3 = \\_ => adv.s; c2 = v.c2; lock_VPSlash=<>};

----------------------------------------
lin

FrontSubj_Subj_V np v = S.mkCl np (S.mkVP v);
FrontSubj_Subj_V_Adv np v adv = PredVP np (ComplV_Adv v adv);
FrontAdv_Subj_V_Adv np v adv = FrontAdv adv (PredVP_Adv np (SlashV_Adv v));

----------------------------------------
lin

MainText s = s;

Pastaende s = S.mkText s;
Join s1 s2 = {s = s1.s ++ s2.s};

Gor cl = S.mkS cl;
GorInte cl = S.mkS S.negativePol cl;
Gjorde cl = S.mkS S.pastTense cl;
GjordeInte cl = S.mkS S.pastTense S.negativePol cl;
HarGjort cl = S.mkS S.anteriorAnt cl; 
HarInteGjort cl = S.mkS S.anteriorAnt S.negativePol cl;

Relativ rcl = S.mkRS rcl;

PositA a = S.mkAP a;
SuperlA a = S.mkAP (S.mkOrd a);

DetCN d cn = S.mkNP d cn;
AdjCN a cn = S.mkCN a cn;
AdvCN cn adv = AS.AdvCN cn adv;
-- AdvCN cn adv = S.mkCN cn adv;
PrepNP p np = S.mkAdv p np;
UseN n = S.mkCN n;
UsePN pn = S.mkNP pn; 
UsePron pron = S.mkNP pron;
IdetCN id cn = S.mkIP id cn;

GenPl np = S.mkDet (AS.GenNP np) S.plNum;
GenSg np = S.mkDet (AS.GenNP np) S.sgNum;
MassNP cn = S.mkNP cn;
ApposCN cn np = S.mkCN cn np;

UseV v = S.mkVP v;
PredVP np vp = S.mkCl np vp;
AdVVP adv vp = S.mkVP adv vp;
AdvVP vp adv = S.mkVP vp adv;

ConjNP c x y = S.mkNP c x y; 
ConjS  c x y = S.mkS  c x y; 
SubjS subj s = S.mkAdv subj s;
AdvS  adv  s = S.mkS adv s; 

CompNP np = AS.CompNP np;
UseComp cmp = AS.UseComp cmp;

}

